<html>

<head>
	<title>Cardapio</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
	<link rel="stylesheet" href="pretty/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
    <script src="pretty/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<?
	include "cabecalho.php" ;
?>
<table width="100%" border="0" cellspacing="0" style="padding-top:20px;">
  <tr style="background-color:#999999; height:50px;"> 
    <td width="12%"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif">C&oacute;digo</font></b></td>
    <td width="56%"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Pizza</font></b></td>
    <td width="32%"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Valor</font></b></td>
    <td width="32%"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Foto</font></b></td>
  </tr>
<?  
	include "conexao.php" ;
	
	$conec->searchPizzas();
	
	while ($dados = $conec->getPizzas()) {  

		$codigo      = $dados['codigo'] ; 
		$pizza 		 = $dados['nome'] ; 
		$descr 		 = $dados['descricao']; 
		$valor 	     = $dados['valor']; 
		$imagem 	 = $dados['foto'];
		$imagem_nome = $dados['nomefoto'];
		
		file_put_contents("temp/".$imagem_nome, $imagem);
		
		echo "<tr bgcolor='#CCCCCC'>" ;
		echo "  <td width='12%'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>$codigo</font></td>" ;
		echo "  <td width='56%'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>$pizza</font></td>" ;
		echo "  <td width='32%'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>$valor</font></td>" ;
		echo "	<td width='32%'><a href='temp/{$imagem_nome}' rel='prettyPhoto' title='{$descr}'><img src='temp/{$imagem_nome}' width='60' height='60' alt='{$pizza}' /></a></td>	";
		echo "</tr>" ;
		echo "<tr bgcolor='#FFFFFF'>" ;
		echo "  <td width='12%'></td>" ;
		echo "  <td width='56%'><font face='Arial, Helvetica, sans-serif' size='2'><i>$descr</i></font></td>" ;
		echo "  <td width='32%'></td>" ;
		echo "</tr>" ;
		
	}
?>
</table>
<?
	include "rodape.php" ;
?>
</body>
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto();
	});
</script>
</html>
